package com.cysd.ewmxns.ui.dialog;
import android.animation.AnimatorSet;
import android.content.Context;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.hjq.permissions.XXPermissions;
import qrrspeeelild.rqrc0ode.andro0ild.R;
public class UserRefusedPermissonDialog extends BaseDialog{
    private TextView txt_content;
    private String mtxt_content;
    private Context mContext;
    private String mPermission;
    public UserRefusedPermissonDialog(@NonNull Context context, String permission) {
        super(context);
        this.mContext = context;
        this.mPermission = permission;

    }

    @Override
    protected float setWidthScale() {
        return 0.8f;
    }

    @Override
    protected AnimatorSet setEnterAnim() {
        return null;
    }

    @Override
    protected AnimatorSet setExitAnim() {
        return null;
    }

    @Override
    protected void init() {
         txt_content = findViewById(R.id.mText_content);
         findViewById(R.id.mCancel).setOnClickListener(v -> {
             dismiss();
         });

         findViewById(R.id.mAccredit).setOnClickListener(v -> {
              XXPermissions.startPermissionActivity(mContext, mPermission);
              dismiss();
         });
       if (mtxt_content !=null) {
           txt_content.setText(mtxt_content);
       }
    }

    @Override
    protected int getContentViewId() {
        return R.layout.popup_all_nopermission;
    }

    public void setPermissionMessage(String txt_content) {
        this.mtxt_content = txt_content;

    }
}
